using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._CartographyTools._Generalization
{
    /// <summary>
    /// <para>Smooth Line</para>
    /// <para>Smooths sharp angles in lines to improve aesthetic or cartographic quality.</para>
    /// <para>平滑线条中的锐角，以提高美观或制图质量。</para>
    /// </summary>    
    [DisplayName("Smooth Line")]
    public class SmoothLine : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public SmoothLine()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_features">
        /// <para>Input Features</para>
        /// <para>The line features to be smoothed.</para>
        /// <para>要平滑的线条特征。</para>
        /// </param>
        /// <param name="_out_feature_class">
        /// <para>Output Feature Class</para>
        /// <para>The output feature class to be created.</para>
        /// <para>要创建的输出要素类。</para>
        /// </param>
        /// <param name="_algorithm">
        /// <para>Smoothing Algorithm</para>
        /// <para><xdoc>
        ///   <para>Specifies the smoothing algorithm.</para>
        ///   <bulletList>
        ///     <bullet_item>Polynomial Approximation with Exponential Kernel (PAEK)—This is the acronym for Polynomial Approximation with Exponential Kernel. A smoothed line that will not pass through the input line vertices will be calculated. This is the default.</bullet_item><para/>
        ///     <bullet_item>Bezier interpolation—Bezier curves will be fitted between vertices. The resulting lines pass through the vertices of the input lines. This algorithm does not require a tolerance. Bezier curves will be approximated in the output.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定平滑算法。</para>
        ///   <bulletList>
        ///     <bullet_item>Multinomial Approximation with Exponential Kernel （PAEK） - 这是 Polynomial Approximation with Exponential Kernel 的首字母缩写。将计算一条不会穿过输入线顶点的平滑线。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>贝塞尔插值—贝塞尔曲线将在顶点之间拟合。生成的线穿过输入线的顶点。此算法不需要容差。贝塞尔曲线将在输出中近似。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// </param>
        /// <param name="_tolerance">
        /// <para>Smoothing Tolerance</para>
        /// <para>A tolerance used by the Polynomial Approximation with Exponential Kernal (PAEK) algorithm. A tolerance must be specified, and it must be greater than zero. You can choose a preferred unit; the default is the feature unit. This parameter is unavailable when the Bezier interpolation algorithm is used.</para>
        /// <para>具有指数核的多项式近似 （PAEK） 算法使用的容差。必须指定公差，并且公差必须大于零。您可以选择首选单位;默认值为要素单位。使用贝塞尔插值算法时，此参数不可用。</para>
        /// </param>
        public SmoothLine(object _in_features, object _out_feature_class, _algorithm_value _algorithm, string? _tolerance)
        {
            this._in_features = _in_features;
            this._out_feature_class = _out_feature_class;
            this._algorithm = _algorithm;
            this._tolerance = _tolerance;
        }
        public override string ToolboxName => "Cartography Tools";

        public override string ToolName => "Smooth Line";

        public override string CallName => "cartography.SmoothLine";

        public override List<string> AcceptEnvironments => ["MDomain", "XYDomain", "XYTolerance", "cartographicPartitions", "extent", "outputCoordinateSystem", "outputMFlag", "outputZFlag", "outputZValue", "scratchWorkspace", "workspace"];

        public override object[] ParameterInfo => [_in_features, _out_feature_class, _algorithm.GetGPValue(), _tolerance, _endpoint_option.GetGPValue(), _error_option.GetGPValue(), _in_barriers];

        /// <summary>
        /// <para>Input Features</para>
        /// <para>The line features to be smoothed.</para>
        /// <para>要平滑的线条特征。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_features { get; set; }


        /// <summary>
        /// <para>Output Feature Class</para>
        /// <para>The output feature class to be created.</para>
        /// <para>要创建的输出要素类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Feature Class")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_feature_class { get; set; }


        /// <summary>
        /// <para>Smoothing Algorithm</para>
        /// <para><xdoc>
        ///   <para>Specifies the smoothing algorithm.</para>
        ///   <bulletList>
        ///     <bullet_item>Polynomial Approximation with Exponential Kernel (PAEK)—This is the acronym for Polynomial Approximation with Exponential Kernel. A smoothed line that will not pass through the input line vertices will be calculated. This is the default.</bullet_item><para/>
        ///     <bullet_item>Bezier interpolation—Bezier curves will be fitted between vertices. The resulting lines pass through the vertices of the input lines. This algorithm does not require a tolerance. Bezier curves will be approximated in the output.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定平滑算法。</para>
        ///   <bulletList>
        ///     <bullet_item>Multinomial Approximation with Exponential Kernel （PAEK） - 这是 Polynomial Approximation with Exponential Kernel 的首字母缩写。将计算一条不会穿过输入线顶点的平滑线。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>贝塞尔插值—贝塞尔曲线将在顶点之间拟合。生成的线穿过输入线的顶点。此算法不需要容差。贝塞尔曲线将在输出中近似。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Smoothing Algorithm")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public _algorithm_value _algorithm { get; set; }

        public enum _algorithm_value
        {
            /// <summary>
            /// <para>Polynomial Approximation with Exponential Kernel (PAEK)</para>
            /// <para>Polynomial Approximation with Exponential Kernel (PAEK)—This is the acronym for Polynomial Approximation with Exponential Kernel. A smoothed line that will not pass through the input line vertices will be calculated. This is the default.</para>
            /// <para>Multinomial Approximation with Exponential Kernel （PAEK） - 这是 Polynomial Approximation with Exponential Kernel 的首字母缩写。将计算一条不会穿过输入线顶点的平滑线。这是默认设置。</para>
            /// </summary>
            [Description("Polynomial Approximation with Exponential Kernel (PAEK)")]
            [GPEnumValue("PAEK")]
            _PAEK,

            /// <summary>
            /// <para>Bezier interpolation</para>
            /// <para>Bezier interpolation—Bezier curves will be fitted between vertices. The resulting lines pass through the vertices of the input lines. This algorithm does not require a tolerance. Bezier curves will be approximated in the output.</para>
            /// <para>贝塞尔插值—贝塞尔曲线将在顶点之间拟合。生成的线穿过输入线的顶点。此算法不需要容差。贝塞尔曲线将在输出中近似。</para>
            /// </summary>
            [Description("Bezier interpolation")]
            [GPEnumValue("BEZIER_INTERPOLATION")]
            _BEZIER_INTERPOLATION,

        }

        /// <summary>
        /// <para>Smoothing Tolerance</para>
        /// <para>A tolerance used by the Polynomial Approximation with Exponential Kernal (PAEK) algorithm. A tolerance must be specified, and it must be greater than zero. You can choose a preferred unit; the default is the feature unit. This parameter is unavailable when the Bezier interpolation algorithm is used.</para>
        /// <para>具有指数核的多项式近似 （PAEK） 算法使用的容差。必须指定公差，并且公差必须大于零。您可以选择首选单位;默认值为要素单位。使用贝塞尔插值算法时，此参数不可用。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Smoothing Tolerance")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public string? _tolerance { get; set; }


        /// <summary>
        /// <para>Preserve endpoint for closed lines</para>
        /// <para><xdoc>
        ///   <para>This is a legacy parameter that is no longer used. It was formerly used to specify whether endpoints of closed lines would be preserved. This parameter is still included in the tool's syntax for compatibility in scripts and models but is hidden from the tool's dialog box.</para>
        ///   <para>Specifies whether the endpoints of closed lines will be preserved. This option works with the PAEK algorithm only.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—The endpoint of a closed line will be preserved. This is the default.</bullet_item><para/>
        ///     <bullet_item>Unchecked—The endpoint of a closed line will not be preserved; it will be smoothed.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>这是不再使用的旧参数。它以前用于指定是否保留闭合行的端点。此参数仍包含在工具的语法中，以便在脚本和模型中兼容，但在工具的对话框中隐藏。</para>
        ///   <para>指定是否保留闭合线的端点。此选项仅适用于 PAEK 算法。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 将保留闭合线的端点。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>未选中 - 不会保留闭合线的端点;它将被平滑。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Preserve endpoint for closed lines")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _endpoint_option_value _endpoint_option { get; set; } = _endpoint_option_value._true;

        public enum _endpoint_option_value
        {
            /// <summary>
            /// <para>FIXED_CLOSED_ENDPOINT</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("FIXED_CLOSED_ENDPOINT")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_FIXED</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_FIXED")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Handling Topological Errors</para>
        /// <para><xdoc>
        ///   <para>Specifies how topological errors (possibly introduced in the process, such as line crossing or overlapping) will be handled.</para>
        ///   <bulletList>
        ///     <bullet_item>Do not check for topological errors—Topological errors will not be identified. This is the default.</bullet_item><para/>
        ///     <bullet_item>Flag topological errors—If topological errors are found, they will be flagged.</bullet_item><para/>
        ///     <bullet_item>Resolve topological errors—If topological errors are found, they will be resolved.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定如何处理拓扑错误（可能在过程中引入，例如越线或重叠）。</para>
        ///   <bulletList>
        ///     <bullet_item>不检查拓扑错误 - 不会识别拓扑错误。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>标记拓扑错误 - 如果发现拓扑错误，将对其进行标记。</bullet_item><para/>
        ///     <bullet_item>解决拓扑错误 - 如果发现拓扑错误，则将解决这些错误。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Handling Topological Errors")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _error_option_value _error_option { get; set; } = _error_option_value._NO_CHECK;

        public enum _error_option_value
        {
            /// <summary>
            /// <para>Do not check for topological errors</para>
            /// <para>Do not check for topological errors—Topological errors will not be identified. This is the default.</para>
            /// <para>不检查拓扑错误 - 不会识别拓扑错误。这是默认设置。</para>
            /// </summary>
            [Description("Do not check for topological errors")]
            [GPEnumValue("NO_CHECK")]
            _NO_CHECK,

            /// <summary>
            /// <para>Flag topological errors</para>
            /// <para>Flag topological errors—If topological errors are found, they will be flagged.</para>
            /// <para>标记拓扑错误 - 如果发现拓扑错误，将对其进行标记。</para>
            /// </summary>
            [Description("Flag topological errors")]
            [GPEnumValue("FLAG_ERRORS")]
            _FLAG_ERRORS,

            /// <summary>
            /// <para>Resolve topological errors</para>
            /// <para>Resolve topological errors—If topological errors are found, they will be resolved.</para>
            /// <para>解决拓扑错误 - 如果发现拓扑错误，则将解决这些错误。</para>
            /// </summary>
            [Description("Resolve topological errors")]
            [GPEnumValue("RESOLVE_ERRORS")]
            _RESOLVE_ERRORS,

        }

        /// <summary>
        /// <para>Input Barrier Layers</para>
        /// <para>Inputs containing features that will act as barriers for smoothing. The resulting smoothed lines will not touch or cross barrier features. For example, when smoothing contour lines, spot height features input as barriers ensure that the smoothed contour lines will not be smooth across these points. The output will not violate the elevation as described by measured spot heights.</para>
        /// <para>包含将充当平滑障碍的特征的输入。生成的平滑线不会接触或穿过障碍要素。例如，在平滑等值线时，将点高度要素输入作为障碍，确保平滑的等值线在这些点上不会平滑。输出不会违反测量的光斑高度所描述的高程。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Barrier Layers")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _in_barriers { get; set; } = null;


        public SmoothLine SetEnv(object MDomain = null, object XYDomain = null, object XYTolerance = null, object cartographicPartitions = null, object extent = null, object outputCoordinateSystem = null, object outputMFlag = null, object outputZFlag = null, object outputZValue = null, object scratchWorkspace = null, object workspace = null)
        {
            base.SetEnv(MDomain: MDomain, XYDomain: XYDomain, XYTolerance: XYTolerance, cartographicPartitions: cartographicPartitions, extent: extent, outputCoordinateSystem: outputCoordinateSystem, outputMFlag: outputMFlag, outputZFlag: outputZFlag, outputZValue: outputZValue, scratchWorkspace: scratchWorkspace, workspace: workspace);
            return this;
        }

    }

}